#ifndef FRIENDLIST_H
#define FRIENDLIST_H

#include "user.h"
#include <QWidget>
#include <qtcpsocket.h>
#include <QHostAddress>
#include <QMessageBox>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonParseError>
#include <QUdpSocket>
#include <QWebSocket>
#include <QCoreApplication>
#include <QtWebSockets/QtWebSockets>
#include <QDebug>
#include <QDateTime>
#include "registerwidget.h"
#include "maininterfacewidget.h"
#include "Global.h"

namespace Ui {
class friendlist;
}

class friendlist : public QWidget
{
    Q_OBJECT

public:
    friendlist(QWidget *parent, user userSelf);
    void closeEvent(QCloseEvent *);
    ~friendlist();

private slots:
    void on_toolButton_infChange_clicked();
    void addfriendsender_clicked();
    void addfriendsearch_clicked();

signals:
    void closefriendlistWidget();

private:
    Ui::friendlist *ui;
    QWebSocket *socket;
    QString ip;
    QString port;
    QNetworkAccessManager manager;
    user userSelf;
    bool messageStatus;
};

#endif // FRIENDLIST_H
